/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package backupit.core.io;

import backupit.core.report.ReportQueue;
import java.beans.XMLDecoder;
import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

/**
 *
 * @author dbotelho
 */
public class LoadReportQueue implements Runnable{
    
    private ReportQueue reportQueue;
    private XMLDecoder decoder;

    public LoadReportQueue(String fileName) throws FileNotFoundException{
        super();
        this.decoder = new XMLDecoder(new BufferedInputStream(
                new FileInputStream(fileName)));
    }

    public void run() {
        reportQueue =(ReportQueue) decoder.readObject();
        decoder.close();
    }

    public ReportQueue getReportQueue() {
        return reportQueue;
    }
}
